package com.riwon.im.common.result;

/**
 * 通用响应码,须经商量后可加入的状态吗,加入需审核
 *
 * @author K.F
 * @since 1.9.2
 * 2017/11/27
 */
public enum CommonRespStatus implements ResponseStatus {

  PARAMETER_ERROR(10100, "参数错误"),
  NEED_REGISTER(403, "请先注册"),
  HAVE_NO_STAFF(10201, "没有客服"),
  DATA404(10086, "数据不存在");


  public final Integer code;
  public final String msg;

  CommonRespStatus(Integer code, String msg) {
    this.code = code;
    this.msg = msg;
  }

  //将响应码注册至全局
  static {
    ResponseStatus.registStatus(CommonRespStatus.values());
  }

  @Override
  public Integer status() {
    return code;
  }

  @Override
  public String statusMsg() {
    return msg;
  }

  @Override
  public String statusDes() {
    return toString().toLowerCase();
  }

}
